/**
 * Licensee: patricio caceres
 * License Type: Evaluation
 */
package ormsamples;

import org.orm.*;
public class ListDocumentacionData {
	private static final int ROW_COUNT = 100;
	
public void listTestData() throws PersistentException {
		orm.DAOFactory lDAOFactory = orm.DAOFactory.getDAOFactory();
		System.out.println("Listing Tan_curso...");
		orm.Tan_curso[] ormTan_cursos = lDAOFactory.getTan_cursoDAO().listTan_cursoByQuery(null, null);
		int length = Math.min(ormTan_cursos.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTan_cursos[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Tan_alumno...");
		orm.Tan_alumno[] ormTan_alumnos = lDAOFactory.getTan_alumnoDAO().listTan_alumnoByQuery(null, null);
		length = Math.min(ormTan_alumnos.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTan_alumnos[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Tan_anotacion...");
		orm.Tan_anotacion[] ormTan_anotacions = lDAOFactory.getTan_anotacionDAO().listTan_anotacionByQuery(null, null);
		length = Math.min(ormTan_anotacions.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTan_anotacions[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Tan_subsector...");
		orm.Tan_subsector[] ormTan_subsectors = lDAOFactory.getTan_subsectorDAO().listTan_subsectorByQuery(null, null);
		length = Math.min(ormTan_subsectors.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTan_subsectors[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Tan_anotador...");
		orm.Tan_anotador[] ormTan_anotadors = lDAOFactory.getTan_anotadorDAO().listTan_anotadorByQuery(null, null);
		length = Math.min(ormTan_anotadors.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTan_anotadors[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Tan_tipoanotacion...");
		orm.Tan_tipoanotacion[] ormTan_tipoanotacions = lDAOFactory.getTan_tipoanotacionDAO().listTan_tipoanotacionByQuery(null, null);
		length = Math.min(ormTan_tipoanotacions.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTan_tipoanotacions[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
	}
	
	public void listByCriteria() throws PersistentException  {
		System.out.println("Listing Tan_curso by Criteria...");
		orm.Tan_cursoCriteria lormTan_cursoCriteria = new orm.Tan_cursoCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//lormTan_cursoCriteria.cu_id_curso.eq();
		lormTan_cursoCriteria.setMaxResults(ROW_COUNT);
		orm.Tan_curso[] ormTan_cursos = lormTan_cursoCriteria.listTan_curso();
		int length =ormTan_cursos== null ? 0 : Math.min(ormTan_cursos.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTan_cursos[i]);
		}
		System.out.println(length + " Tan_curso record(s) retrieved."); 
		
		System.out.println("Listing Tan_alumno by Criteria...");
		orm.Tan_alumnoCriteria lormTan_alumnoCriteria = new orm.Tan_alumnoCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//lormTan_alumnoCriteria.al_id_alumno.eq();
		lormTan_alumnoCriteria.setMaxResults(ROW_COUNT);
		orm.Tan_alumno[] ormTan_alumnos = lormTan_alumnoCriteria.listTan_alumno();
		length =ormTan_alumnos== null ? 0 : Math.min(ormTan_alumnos.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTan_alumnos[i]);
		}
		System.out.println(length + " Tan_alumno record(s) retrieved."); 
		
		System.out.println("Listing Tan_anotacion by Criteria...");
		orm.Tan_anotacionCriteria lormTan_anotacionCriteria = new orm.Tan_anotacionCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//lormTan_anotacionCriteria.an_id_anotacion.eq();
		lormTan_anotacionCriteria.setMaxResults(ROW_COUNT);
		orm.Tan_anotacion[] ormTan_anotacions = lormTan_anotacionCriteria.listTan_anotacion();
		length =ormTan_anotacions== null ? 0 : Math.min(ormTan_anotacions.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTan_anotacions[i]);
		}
		System.out.println(length + " Tan_anotacion record(s) retrieved."); 
		
		System.out.println("Listing Tan_subsector by Criteria...");
		orm.Tan_subsectorCriteria lormTan_subsectorCriteria = new orm.Tan_subsectorCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//lormTan_subsectorCriteria.su_id_subsector.eq();
		lormTan_subsectorCriteria.setMaxResults(ROW_COUNT);
		orm.Tan_subsector[] ormTan_subsectors = lormTan_subsectorCriteria.listTan_subsector();
		length =ormTan_subsectors== null ? 0 : Math.min(ormTan_subsectors.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTan_subsectors[i]);
		}
		System.out.println(length + " Tan_subsector record(s) retrieved."); 
		
		System.out.println("Listing Tan_anotador by Criteria...");
		orm.Tan_anotadorCriteria lormTan_anotadorCriteria = new orm.Tan_anotadorCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//lormTan_anotadorCriteria.an_id_rut.eq();
		lormTan_anotadorCriteria.setMaxResults(ROW_COUNT);
		orm.Tan_anotador[] ormTan_anotadors = lormTan_anotadorCriteria.listTan_anotador();
		length =ormTan_anotadors== null ? 0 : Math.min(ormTan_anotadors.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTan_anotadors[i]);
		}
		System.out.println(length + " Tan_anotador record(s) retrieved."); 
		
		System.out.println("Listing Tan_tipoanotacion by Criteria...");
		orm.Tan_tipoanotacionCriteria lormTan_tipoanotacionCriteria = new orm.Tan_tipoanotacionCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//lormTan_tipoanotacionCriteria.ta_id_tipoanotacion.eq();
		lormTan_tipoanotacionCriteria.setMaxResults(ROW_COUNT);
		orm.Tan_tipoanotacion[] ormTan_tipoanotacions = lormTan_tipoanotacionCriteria.listTan_tipoanotacion();
		length =ormTan_tipoanotacions== null ? 0 : Math.min(ormTan_tipoanotacions.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTan_tipoanotacions[i]);
		}
		System.out.println(length + " Tan_tipoanotacion record(s) retrieved."); 
		
	}
	
	public static void main(String[] args) {
		try {
			ListDocumentacionData listDocumentacionData = new ListDocumentacionData();
			try {
				listDocumentacionData.listTestData();
				//listDocumentacionData.listByCriteria();
			}
			finally {
				orm.DocumentacionPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
